{% macro pic_path(pic) %}
	{{ url_for('return_pic', filename='%s' % pic) }}
{% endmacro %}

{% extends "base.html" %}
{% block title %}
Open Source Image Sharer
{% endblock %}
{% block content %}
	{% if filename is defined %}
		<div id="image"><a href="{{ pic_path(filename) }}" target="_blank"><img class="new" src="{{ pic_path(filename) }}"></a></div>
	{% else %}
		<ul>
		{% for pic in pics %}
			<li class="thumb"><a href="{{ url_for('show_pic', filename=pic) }}"><img class="thumb" src="{{ pic_path('thumb_'+pic) }}"></a></li>
		{% endfor %}
		</ul>
	{% endif %}		    
{% endblock %}
